package priv.dajie.tzzq.bot.model;

import java.util.ArrayList;
import java.util.HashMap;

/**
 * @ClassName BuffSteamPackItems
 * @Description
 * @Author dajie
 * @Date 2019/9/18 12:41 上午
 * @Version V1.0
 **/
public class BuffSteamPackItems extends ArrayList<BuffSteamPackItem> {
    private HashMap<String, BuffSteamPackItem> steamNameMap = null;

    public HashMap<String, BuffSteamPackItem> getSteamNameMap(){
        if(steamNameMap == null){
            synchronized (this){
                if(steamNameMap == null){
                    steamNameMap = new HashMap<>(size());
                    for(BuffSteamPackItem buffSteamPackItem : this){
                        steamNameMap.put(buffSteamPackItem.getSteamName(), buffSteamPackItem);
                    }
                }
            }
        }
        return steamNameMap;
    }

}
